import Vue from 'vue'
import App from './App'
import request from "./utils/request.js"

Vue.config.productionTip = false

App.mpType = 'app'

/* 获取全局缓存手机号码 */
Vue.mixin({
	data() {
		return {
			phone: "",
			userType: "",
			userFlag: "",
			msgCount: 0
		}
	},
	created() {
		this.setStorage()
	},
	onShow() {
		this.setStorage()
	},
	methods: {
		setStorage() {
			this.phone = uni.getStorageSync("phone") || ""
			this.userFlag = uni.getStorageSync("userFlag") || ""
			this.userType = uni.getStorageSync("userType") || ""
		}
	}
})

Vue.prototype.request = request

const app = new Vue({
	...App
})
app.$mount()
